#!/bin/bash
set -e

echo Starting rancher server
cd $(dirname $0)/..

CMD=bin/rancher
if [ ! -x $CMD ]; then
    ./scripts/build-server
fi

rm -rf build/testdata
mkdir -p build/testdata
cd build/testdata
export KUBECONFIG=
export CATTLE_DEV_MODE=yes
export CATTLE_SERVER_URL="https://$(ip route get 8.8.8.8 | awk '{print $7}'):8443"
exec ../../$CMD
